function main(defaultParams) {
    let self = this;
    debugger
    // 在表单部件中的数据保存成功时刷新表格
    if (defaultParams.moduleActionType === 'form-save') {
        let approvalResult = defaultParams.callbackParams.data['t_655b23a930504145bf2ba2f014780dc6'].radio_dsqptz;
        let approvalTypeCode = defaultParams.approval_type_code.value;
        let human_id = defaultParams.id.value;
        let identityNoValue = defaultParams.identity_no.value;
        // 1 人员新增审核
        // 2 人员辞退审核
        // 3 人员拉黑审核
        // 4 人员删除审核
        if (approvalTypeCode === '1') {
            if (approvalResult === '1') {
                api.EXEC_FORMULA("UPDATE('t_2488d76f089b4f00aae44062307659fd', QUERY_EQ('id', " + human_id + "), '', ['valid_flag', 1])").then((res) => {
                    if (res.result) {
                        console.log('更新成功');
                        syncHumanToUserCenter(human_id, self)
                        updateList(self);
                    }
                });
            } else {
                api.EXEC_FORMULA("UPDATE('t_2488d76f089b4f00aae44062307659fd', QUERY_EQ('id', " + human_id + "), '', ['valid_flag', -1])").then((res) => {
                    if (res.result) {
                        console.log('更新成功');
                        updateList(self);
                    }
                });
            }
        } else if (approvalTypeCode === '2') {
            if (approvalResult === '1') {
                api.EXEC_FORMULA("UPDATE('t_2488d76f089b4f00aae44062307659fd', QUERY_EQ('id', " + human_id + "), '', ['work_status_code', '6','work_status_name','已辞退'])").then((res) => {
                    if (res.result) {
                        console.log('更新成功');
                        syncHumanToUserCenter(human_id, self)
                        updateList(self);
                    }
                });
            } else {
                updateList(self);
            }
        } else if (approvalTypeCode === '3') {
            if (approvalResult === '1') {
                api.EXEC_FORMULA("UPDATE('t_2488d76f089b4f00aae44062307659fd', QUERY_EQ('id', " + human_id + "), '', ['work_status_code', '10','work_status_name','已拉黑'])").then((res) => {
                    if (res.result) {
                        console.log('更新成功');
                        syncHumanToUserCenter(human_id, self)
                        updateList(self);
                    }
                });
            } else {
                updateList(self);
            }
        } else if (approvalTypeCode === '4') {
            if (approvalResult === '1') {
                api.EXEC_FORMULA("UPDATE('t_2488d76f089b4f00aae44062307659fd', QUERY_EQ('id', " + human_id + "), '', ['delete_flag', '1','identity_no','" + identityNoValue + "'])").then((res) => {
                    if (res.result) {
                        console.log('更新成功');
                        syncHumanToUserCenter(human_id, self)
                        updateList(self);
                    }
                });
            } else {
                updateList(self);
            }
        }

    }
}

// 同步数据到用户中心
function syncHumanToUserCenter(params, self) {
    var syncData = [{ name: "id", valueContent: params }];
    return api.DATA_SOURCE_EXECUTE(
        "ds_api:7a33e6eb-1ea6-46d3-be49-afca3a903a58",
        "api",
        syncData,
        [],
        ""
    ).then(function (res) {
        var result = JSON.parse(res.result);
        console.log("同步用户中心成功:", result);
        return result;

    }).catch(function (error) {
        console.error("同步用户中心失败:", error);
        throw error;
    });
}

function updateList(self) {
    // 获取页面列表组件
    var pageListEle = self.$$("page_widget_list_h29unn");
    var pageListEle1 = self.$$("page_widget_list_1ghz3s");
    var pageListEle2 = self.$$("page_widget_list_e0vbq");
    // 获取列表渲染页实例
    var listRenderView = pageListEle.$$getRenderElement();
    var listRenderView1 = pageListEle1.$$getRenderElement();
    var listRenderView2 = pageListEle2.$$getRenderElement();
    // 获取当前显示的组件，表格或者卡片
    var currentListEle = listRenderView.$$getListElement();
    var currentListEle1 = listRenderView1.$$getListElement();
    var currentListEle2 = listRenderView2.$$getListElement();
    // 调用刷新方法
    currentListEle.$$refreshData();
    currentListEle1.$$refreshData();
    currentListEle2.$$refreshData();
}
